package com.azkj.album.adapter;

import android.widget.TextView;

import com.azkj.album.R;
import com.azkj.album.dto.HistoryBean;
import com.azkj.album.network.utils.MyDateUtils;
import com.azkj.album.utils.NumberUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.Date;

public class HistotyAdapter extends BaseQuickAdapter<HistoryBean, BaseViewHolder> {

    public HistotyAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, HistoryBean item) {
        TextView paDate = helper.getView(R.id.et_00);
        paDate.setText(item.getPaytimeText() + "");
        Date date = new Date();
        date.setTime(item.getPaytime() * 1000);
        String stringData = MyDateUtils.getDate2String3(date);
        paDate.setText(stringData);

        TextView payClass = helper.getView(R.id.et_11);
        payClass.setText(item.getMonth() + "个月");

        TextView payPhone = helper.getView(R.id.et_22);
        payPhone.setText(item.getUser().getMobile());

        TextView payPrice = helper.getView(R.id.et_33);
        Double nowPrice = NumberUtil.getTwoDecimal(Double.valueOf(item.getOrderPrice()));
        payPrice.setText("¥" + nowPrice);

    }
}
